package com.aaa.doctor.controller.api;


import com.aaa.doctor.service.SchedulingService;
import com.aaa.doctor.vo.DeptVo;
import com.aaa.doctor.vo.Scheduling2Vo;
import com.aaa.doctor.vo.SchedulingVo;
import com.aaa.entity.Scheduling;
import com.aaa.entity.User;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.beans.PropertyEditorSupport;
import java.util.List;

@RestController
@RequestMapping("/doctor/api/scheduling")
public class ApiSchedulingController {

    @Autowired
    private SchedulingService schedulingService;

    /**
     * 医生排班
     * 条件查询
     * @param schedulingVo
     * @return
     */
    @PostMapping("/queryScheduling")
    public Result queryScheduling(@RequestBody SchedulingVo schedulingVo){
        return schedulingService.queryScheduling(schedulingVo);
    }

    /**
     * 医生排班编辑-->修改排班信息
     * @param scheduling2Vo
     * @return
     */
    @PostMapping("/editScheduling")
    public Result editScheduling(@RequestBody Scheduling2Vo scheduling2Vo){
        return schedulingService.updScheduling(scheduling2Vo);
    }

    /**
     * 医生名称字典
     * @return
     */
    @GetMapping("/initUser")
    public Result <List<User>> initUser( ){
        return schedulingService.initUser( );
    }

    /**
     * 我的排版
     * @param scheduling
     * @return
     */
    @PostMapping("/getinitUser")
    public  Result<User> getinitUser(@RequestBody SchedulingVo scheduling){
        return schedulingService.getinitUser(scheduling);
    }

    /**
     * 门诊挂号页面
     * 查询挂号列表
     * @param deptVo
     * @return
     */
    @PostMapping("/listDeptForScheduling")
    public Result<List<Scheduling>> listDeptForScheduling(@RequestBody DeptVo deptVo){
        return schedulingService.listDeptForScheduling(deptVo);
    }

}





